export interface User {
  id: number | string
  name: string
  username: string
  email: string
  role: 'admin' | 'user' | 'guest'
  avatar?: string
  createdAt?: string
  updatedAt?: string
}
// 登录数据
export interface LoginCredentials {
  email: string
  password?: string
}
// 注册数据
export interface RegisterData {
  name: string
  email: string
  password?: string
  password_confirmation?: string
}
// 个人信息
export interface Auth {
  user: User | null
   token: string | null
   isAuthenticated: boolean
   isLoading: boolean
}
// 用户资料更新
export interface UserProfile {
  avatar: string,
  name: string,
   profile: {
      bio?: string,
      website?: string,
      location?: string,
      company?: string
    },
}
export interface Permission {
  id: string
  name: string
  code: string
  description?: string
}

// ==================== userManagement(role):用户权限相关配置 ====================

export interface TableDataItem {
  id: number
  username: string
  email: string
  role: string | 'admin' | 'user' | 'guest'
  permissions: string[]
  status: string |'active' | 'inactive'
}

export interface SearchParams {
  username: string
  role: string
  page: number
  size: number
}

export interface PermissionForm {
  userId: number
  role: string
  permissions: string[]
}